Writing Message Scripts

When you add a button to an object, you are adding a script for a message that takes no arguments.  Often objects need to understand messages that take arguments.  In this chapter you’ll write scripts that take arguments and write messages to run them.

When you tap a button in an object that you created, a message is sent to your object.  That message takes no arguments.  Typically, the script for the button then sends the object more messages to do the bulk of the work.  These messages are not associated with a button: the object understands them, but they are only sent from other scripts.  This will become more clear as you read this chapter.

In this chapter, you’ll need the cash-register object built in the chapter above.  You should have its form view open and in author-mode.  You will also need to have a browser view of the cash-register open and the workspace open.

To open the browser view of cash-register:
1.
Double-tap on the title bar of the cash-register window.  A pop-up menu appears.
2.
Tap on Open Browser in the Object Development section of the menu.  The browser appears.